package com.atguigu.common.exception;

import lombok.Data;

/**
 * @author achao
 * @version 1.0
 */
@Data
public class CustomException extends RuntimeException {

    private String message;
    private Integer code;
    private ResultCodeEnum resultCodeEnum;
    public CustomException(String message, Integer code) {
        this.message = message;
        this.code = code;
    }

    public CustomException(ResultCodeEnum resultCodeEnum) {
        this.message = resultCodeEnum.getMessage();
        this.code = resultCodeEnum.getCode();
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }
}
